Add colour preview method #63
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Colour previews
Allows users to easily preview a colour using the
Color.preview()method.What changed?
A new
previewmethod was added to theColorclass, allowing for quick and easy colour previews.How does it work?
The preview method uses Tkinter, which is included in every Python installation, and should be consistent across operating systems.
The method creates a root window, sets its geometry, sets its title and sets the background colour to whatever colour is stored in this
Colorclass.Why?
I was recently browsing old projects of mine, and I stumbled across a list of
Colorobjects. Wanting to view those colours, I searched for a quick and easy way to preview colours in Python.After failing miserably, I took it upon myself to implement a preview method for the
Colorclass.Also, why would anyone want to implement an essential feature all by themselves?
Examples